<!doctype html>

<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
{% block head %}
    <title>个人技术博客</title>
{% endblock %}
<link href="/static/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<link href="/static/css/style.css" type="text/css" rel="stylesheet">
<link type="text/css" href="/static/css/nprogress.css" rel="stylesheet">
<!--[if lt IE 9]>
    <script src="/static/js/html5shiv.min.js" type="text/javascript"></script>
    <script src="/static/js/respond.min.js" type="text/javascript"></script>
    <script src="/static/js/selectivizr-min.js" type="text/javascript"></script>
<![endif]-->
<link rel="apple-touch-icon-precomposed" href="/static/images/icon/icon.png">
<link rel="shortcut icon" href="/static/images/icon/favicon.ico">
<meta name="Keywords" content="" />
<meta name="description" content="" />
<script type="text/javascript">

//判断浏览器是否支持HTML5
/*window.onload = function() {
	if (!window.applicationCache) {
		window.location.href="ie.html";
	}
}*/
</script>
</head>

<body>
<section class="container user-select">
  <header>
    <div class="hidden-xs header"><!--超小屏幕不显示-->
      <h1 class="logo"> <a href="index.html" title="个人技术博客"></a> </h1>
      <ul class="nav hidden-xs-nav">
          {% if request.session.username %}
              <li style="text-align: center;width:80%;margin: 10px auto;background: greenyellow;border-radius: 25%">
                        欢迎您；<strong>{{ request.session.username }}</strong></li>
              <li style="text-align: center;width: 50%;margin: 0 auto;background: gray;border-radius: 25%">
                        <a id='switchuser' style="padding:0;color: white;"
                           href="/login/switchuser/">退出
                        </a>
                    </li>
          {% else %}
              <li style="width: 80%;margin: 10px auto;text-align: center;background: yellow;border-radius: 25%">
                   <span style="font-weight: bolder"><a href="/login/">登录</a></span>
                        |
                   <span><a href="/login/reg/">注册</a></span>
              </li>
          {% endif %}
        <li class="active"><a href="index.html"><span class="glyphicon glyphicon-home"></span>网站首页</a></li>
        <li><a href="/index/?page=1&classify=1"><span class="glyphicon glyphicon-erase"></span>网站前端</a></li>
        <li><a href="/index/?page=1&classify=2"><span class="glyphicon glyphicon-inbox"></span>后端技术</a></li>
        <li><a href=""><span class="glyphicon glyphicon-globe"></span>管理系统</a></li>
        <li><a href="about.html"><span class="glyphicon glyphicon-user"></span>关于我们</a></li>
        <li><a href="friendly.html"><span class="glyphicon glyphicon-tags"></span>友情链接</a></li>
      </ul>
      <div class="feeds"> <a class="feed feed-xlweibo" href="" target="_blank"><i></i>新浪微博</a> <a class="feed feed-txweibo" href="" target="_blank"><i></i>腾讯微博</a> <a class="feed feed-rss" href="" target="_blank"><i></i>订阅本站</a> <a class="feed feed-weixin" data-toggle="popover" data-trigger="hover" title="微信扫一扫" data-html="true" data-content="<img src='/static/images/weixin.jpg' alt=''>" href="javascript:;" target="_blank"><i></i>关注微信</a> </div>
      <div class="wall"><a href="readerWall.html" target="_blank">读者墙</a> | <a href="tags.html" target="_blank">标签云</a></div>
    </div>
    <!--/超小屏幕不显示-->
    <div class="visible-xs header-xs"><!--超小屏幕可见-->
      <div class="navbar-header header-xs-logo">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#header-xs-menu" aria-expanded="false" aria-controls="navbar"><span class="glyphicon glyphicon-menu-hamburger"></span></button>
      </div>
      <div id="header-xs-menu" class="navbar-collapse collapse">
        <ul class="nav navbar-nav header-xs-nav">
          <li class="active"><a href="index.html"><span class="glyphicon glyphicon-home"></span>网站首页</a></li>
          <li><a href=""><span class="glyphicon glyphicon-erase"></span>网站前端</a></li>
          <li><a href=""><span class="glyphicon glyphicon-inbox"></span>后端技术</a></li>
          <li><a href=""><span class="glyphicon glyphicon-globe"></span>管理系统</a></li>
          <li><a href="about.html"><span class="glyphicon glyphicon-user"></span>关于我们</a></li>
          <li><a href="friendly.html"><span class="glyphicon glyphicon-tags"></span>友情链接</a></li>
        </ul>
        <form class="navbar-form" action="search.php" method="post" style="padding:0 25px;">
          <div class="input-group">
            <input type="text" class="form-control" placeholder="请输入关键字">
            <span class="input-group-btn">
            <button class="btn btn-default btn-search" type="submit">搜索</button>
            </span> </div>
        </form>
      </div>
    </div>
  </header>
  <!--/超小屏幕可见-->
  {% block body %}

  {% endblock %}
  <!--/内容-->
  <aside class="sidebar visible-lg"><!--右侧>992px显示-->
    <div class="sentence"> <strong>每日一句</strong>
      <h2 id="TimeDV">2015年11月1日 星期日</h2> {# 设置获取当掐时间，和设置定时器，不断刷新时间日期 #}
      <p>{{ random_sen.content }}</p>{# 设置随即每日一句 #}
    </div>
    <div id="search" class="sidebar-block search" role="search">
      <h2 class="title"><strong>搜索</strong></h2>
      <form class="navbar-form" action="search.php" method="post">
        <div class="input-group">
          <input type="text" class="form-control" size="35" placeholder="请输入关键字">
          <span class="input-group-btn">
          <button class="btn btn-default btn-search" type="submit">搜索</button>
          </span> </div>
      </form>
    </div>
    <div class="sidebar-block recommend">
      <h2 class="title"><strong>热门推荐</strong></h2>
      <ul>
          {% for right_hot in right_hot_post %}
              <li>
                  <a target="_blank" href="/detail/?id={{ right_hot.id }}">
                      <span class="thumb">
                          <img src="{{ right_hot.thumb }}" alt="">
                      </span>
                      <span class="text">{{ right_hot.title }}</span>
                      <span class="text-muted">阅读({{ right_hot.look }})</span>
                  </a>
              </li>

          {% endfor %}

      </ul>
    </div>
    <div class="sidebar-block comment">
      <h2 class="title"><strong>最新评论</strong></h2>
      <ul>
          {% for latest in latest_comment %}
              <li data-toggle="tooltip" data-placement="top" title="{{ latest.name }}">
                  <a target="_blank" href="">
                      <span class="face">
                          <img src="/static/images/icon/icon.png" alt="">
                      </span>
                      <span class="text">
                          <strong>{{ latest.name }}</strong> ({{ latest.time }}) 说：<br />
                          {{ latest.content}}
                      </span>
                  </a>
              </li>
          {% endfor %}


      </ul>
    </div>
  </aside>
  <!--/右侧>992px显示-->

</section>
<div><a href="javascript:;" class="gotop" style="display:none;"></a></div>
<!--/返回顶部-->
<script src="/static/js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="/static/js/nprogress.js" type="text/javascript" ></script>
<script src="/static/js/bootstrap.min.js" type="text/javascript"></script>
{#每日一句--时间设置#}
<script>
    let timeDv = document.getElementById("TimeDV");
    function timeGo(){
        let date = new Date();  {# 创建时间对象 #}
        let year = date.getFullYear();  {# 获取年份 #}
        let month = date.getMonth() + 1; {# 获取月份 #}
        let day = date.getDate()  {# 获取天 #}
        let week = date.getDay()  {#  获取星期 #}
        let hour = date.getHours()  {# 获取小时 #}
        let Minute = date.getMinutes()  {# 获取分钟 #}
        let second = date.getSeconds()  {# 获取秒数 #}
        let date_string = year + "年" + oneToTwo(month) + "月" + oneToTwo(day) + "日 " + toWeek(week) + oneToTwo(hour)  + ":" + oneToTwo(Minute) + ":" + oneToTwo(second)
        timeDv.innerText = date_string

    }
    {# 星期转换 #}
    function toWeek(week){
        switch (week) {
            case 0:return "星期日 ";
            case 1:return "星期一 ";
            case 2:return "星期二 ";
            case 3:return "星期三 ";
            case 4:return "星期四 ";
            case 5:return "星期五 ";
            case 6:return "星期六 ";

        }
    }
    {# 对时间补全单位数成双位数 #}
    function oneToTwo(time){
        return time < 10 ? "0" + time : time
    }
    {# 调用函数 #}
    timeGo()
    {# 设置定时器，随时刷新时间，让时间称为动态的，这里设每秒书信一次 #}
    setInterval(timeGo, 1000)


</script>

{% block script %}

{% endblock %}
</body>
</html>
